import httpInstance from '@/utils/http.js'

export function getCheckInfoAPI () {
  return httpInstance({
    url: `/api/order/info/recent/`,
  })
}


export function postCheckInfoAPI () {
  return httpInstance({
    url: `/api/order/info/`,
    method:'POST',
  })
}


//新增地址-省
export function getAddressAPI () {
  return httpInstance({
    url: `/api/address/info/province/`,
    
  })
}
//新增地址-市
export function getAddressCityAPI (params) {
  return httpInstance({
    url: `/api/address/info/city/`,
    params
  })
}
//新增地址-区
export function getAddressDistinctAPI (params) {
  return httpInstance({
    url: `/api/address/info/district/`,
    params
  })
}


export function getAddressListAPI() {
  return httpInstance({
    url: `/api/recipient/info/`,
  })
}
export function addAddressAPI (data) {
  return httpInstance({
    url: `/api/recipient/info/`,
    method:'POST',
    data
  })
}

//创建订单/member/order
export function createOrderAPI (data) {
  return httpInstance({
    url: `/api/icb/info/create-pay-order/`,
    method:'POST',
    data
  })
}

//删除地址
export function deleteAddressAPI (id) {
  return httpInstance({
    url: `/api/recipient/info/delete_single/`,
    method:'DELETE',
    data:{
      id
    }
  })
}


export function againPayAPI (data) {
  return httpInstance({
    url: `/api/icb/info/create-pay-order/`,
    method:'POST',
    data
  })
}